package com.ruoyi.lm.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.lm.domain.LmUserpick;
import com.ruoyi.lm.service.ILmUserpickService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 用户关注列Controller
 * 
 * @author ruoyi
 * @date 2020-09-27
 */
@Controller
@RequestMapping("/phone/lm/userpick")
public class LmUserpickControllerPhone extends BaseController
{
    private String prefix = "lm/userpick";

    @Autowired
    private ILmUserpickService lmUserpickService;
    /**
     * 查询用户关注列列表
     */
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(@RequestBody LmUserpick lmUserpick)
    {
        List<LmUserpick> list = lmUserpickService.selectLmUserpickList(lmUserpick);
        return getDataTable(list);
    }

    /**
     * 新增保存用户关注列
     */
    @PostMapping("/add")
    @ResponseBody
    public AjaxResult addSave(@RequestBody LmUserpick lmUserpick)
    {
        return toAjax(lmUserpickService.insertLmUserpick(lmUserpick));
    }

    /**
     * 修改保存用户关注列
     */
    @PostMapping("/edit")
    @ResponseBody
    public AjaxResult editSave(@RequestBody LmUserpick lmUserpick)
    {
        return toAjax(lmUserpickService.updateLmUserpick(lmUserpick));
    }

    /**
     * 删除用户关注列
     */
    @PostMapping( "/remove")
    @ResponseBody
    public AjaxResult remove(String ids)
    {
        return toAjax(lmUserpickService.deleteLmUserpickByIds(ids));
    }
}
